package com.song.controller.user;

import com.song.entity.Category;
import com.song.result.Result;
import com.song.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController("user-CategoryController")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;
    //分类查询菜品或套餐列表接口
    @GetMapping("/list")
    public Result<List<Category>> getDishAndSetmealList( Integer type){
    log.info("分类查询菜品或套餐列表接口,参数type：{}",type);
        return Result.success(categoryService.getCategoryByType(type),"查询成功");
    }
}
